<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <div th:replace="header::common"></div>
</head>
<body>
   <form action="/user/update" method="post">
       <input type="hidden" th:value="${user.id}" name="id">
       <div class="form-group">
           <label for="username">用户名</label>
           <input type="text" th:value="${user.username}" class="form-control" id="username" name="username">
       </div>
       <div class="form-group">
           <label for="password">密码</label>
           <input type="text" th:value="${user.password}" class="form-control" id="password" name="password">
       </div>
       <div class="form-group">
           <label for="email">邮箱</label>
           <input type="text" th:value="${user.email}" class="form-control" id="email" name="email">
       </div>
       <div class="form-group">
           <label for="phone">手机号</label>
           <input type="text" th:value="${user.phone}" class="form-control" id="phone" name="phone">
       </div>
       <div class="form-group">
           <label>角色</label>
           <input type="radio" th:checked="${user.role==0}" name="role" value="0"/>管理员
           <input type="radio" th:checked="${user.role==1}" name="role" value="1"/>普通用户
       </div>
       <div class="form-group">
           <label>部门</label>
           <select name="deptId" class="form-control">
               <option th:each="dept:${list}" th:selected="${dept.id==user.deptId}" th:value="${dept.id}" th:text="${dept.name}"></option>
           </select>
       </div>
       <input class="btn btn-primary" type="submit" value="更新">
   </form>
</body>
</html>